//    Copyright 2021 Cardinal
//
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//
//        http://www.apache.org/licenses/LICENSE-2.0
//
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.

import java.util.concurrent.atomic.AtomicInteger;

class Printer {
    static AtomicInteger isShowing = new AtomicInteger(0);
}

class PrintNum extends Printer implements Runnable {
    @Override
    public void run() {
        for (int i = 1; i <= 52; i++) {
            if ((isShowing.get() & 1) == 0) {
                System.out.print(i);
                i++;
                if (i <= 52) {
                    System.out.print(i);
                }
                isShowing.incrementAndGet();
            }
            else{
                i--;
            }
        }
    }
}

class PrintChar extends Printer implements Runnable {
    @Override
    public void run() {
        for (char c = 'A'; c <= 'Z'; c++) {
            if ((isShowing.get() & 1) == 1) {
                System.out.print(c);
                isShowing.incrementAndGet();
            }
            else{
                c--;
            }
        }
    }
}

public class homework_3 {
    public static void main(String[] args) {
        new Thread(new PrintNum()).start();
        new Thread(new PrintChar()).start();
    }
}
